<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="content">
    <c:url value="/pengelola" var="pengelola_url"/>

    <form:form action="${pengelola_url}" method="PUT" modelAttribute="pengelola">
        <form:hidden path="id" id="id"/>
        <div class="blocksection">
            <div class="blockcontent">
                <h3>Masukkan Perubahan Data Pengelola</h3>
                <dl class="form-text">

                    <dt>
                        <label for="nama">Nama :</label>
                    </dt>
                    <dd>
                        <form:input path="nama" id="nama"/>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="nama"/>
                        <p class="description">Masukkan Nama Pengelola.</p>
                    </dd>

                    <dt>
                        <label for="telp">No telp :</label>
                    </dt>
                    <dd>
                        <form:input path="telp" id="telp"/>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="telp"/>
                        <p class="description">Masukkan No Telp Pengelola.</p>
                    </dd>

                    <dt>
                        <label for="instansi">Instansi :</label>
                    </dt>
                    <dd>
                        <form:select path="instansi" id="instansi">
                            <%--<form:option label="--pilih--" value=""/>--%>
                            <c:forEach items="${instansiList}" var="instansiItem">
                                <form:option value="${instansiItem}" label="${instansiItem.nama}"/>
                            </c:forEach>
                        </form:select>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="instansi"/>
                    </dd>
                    <dt>
                        <label for="jabatan">Jabatan :</label>
                    </dt>
                    <dd>
                        <form:select path="jabatan" id="jabatan">
                            <%--<form:option label="--pilih--" value=""/>--%>
                            <c:forEach items="${jabatanList}" var="jabatanItem">
                                <form:option value="${jabatanItem}" label="${jabatanItem.nama}"/>
                            </c:forEach>
                        </form:select>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="jabatan"/>
                    </dd>

                    <dt>
                        <label for="username">User Name :</label>
                    </dt>
                    <dd>
                        <form:input path="username" id="username"/>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="username"/>
                        <p class="description">Masukkan User Name Pengelola.</p>
                    </dd>

                    <dt>
                        <label for="password">Password :</label>
                    </dt>
                    <dd>
                        <form:password path="password" id="password"/>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="password"/>
                        <p class="description">Masukkan Password Pengelola.</p>
                    </dd>

                    <dt>
                        <label for="role">Role :</label>
                    </dt>
                    <dd>
                        <form:select path="role" id="role">
                            <%--<form:option label="--pilih--" value=""/>--%>
                            <c:forEach items="${roleList}" var="roleItem">
                                <form:option value="${roleItem}" label="${roleItem.authority}"/>
                            </c:forEach>
                        </form:select>
                        <form:errors delimiter="&lt;p/&gt;" cssClass="boxinfo error"
                                     path="role"/>
                    </dd>
                </dl>
            </div>
        </div>
        <div class="form-button">
            <div class="buttonWrapper">
                <a href="<c:url value='/pengelola'/>" class="back">Kembali</a>
            </div>
            <input type="submit" value="Simpan" name="submit_1" id="submit_1"/>
            <input class="grey" type="reset" value="Hapus" name="reset_1" id="reset_1"/>
        </div>
    </form:form>
</div>
